From: Keir Fraser Date: Thu, 5 Mar 2009 15:10:17 +0000 (+0000) Subject: xend: blkif hda regexp fix X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13995^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=eea1a2ea39c515883920171be2e63286f3c89e94;p=xen.git xend: blkif hda regexp fix Signed-off-by: Michal Novotny --- diff --git a/tools/python/xen/util/blkif.py b/tools/python/xen/util/blkif.py index 74935774a6..29b23fb7dd 100644 --- a/tools/python/xen/util/blkif.py +++ b/tools/python/xen/util/blkif.py @@ -33,7 +33,7 @@ def blkdev_name_to_number(name): major = scsi_major[((ord(n[7:8]) - ord('a') + 1) * 26 + (ord(n[8:9]) - ord('a'))) / 16 ] minor = (((ord(n[7:8]) - ord('a') + 1 ) * 26 + (ord(n[8:9]) - ord('a'))) % 16) * 16 + int(n[9:] or 0) devnum = major * 256 + minor - elif re.match( '/dev/hd[a-t]([1-9]|[1-5][0-9]|6[0-3])?', n): + elif re.match( '/dev/hd[a-t]([1-9]|[1-5][0-9]|6[0-3])?$', n): ide_majors = [ 3, 22, 33, 34, 56, 57, 88, 89, 90, 91 ] major = ide_majors[(ord(n[7:8]) - ord('a')) / 2] minor = ((ord(n[7:8]) - ord('a')) % 2) * 64 + int(n[8:] or 0)